﻿using System;
using System.Collections.Generic;
using System.Text;
using DotNet.Data;
using DotNet.Model;
using System.Data;
namespace DotNet.Business
{
	public class ProgramBll
	{
		ProgramDal pDal=new ProgramDal();

		#region 是否存在该记录
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int programId)
		{
			return pDal.Exists(programId);
		}
		#endregion

		#region 获得数据列表
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public IList<Program> GetModel()
		{
			return pDal.GetModel();
		}
		#endregion

		#region 根据标识列获得数据实体
		/// <summary>
		/// 根据标识列获得数据实体
		/// </summary>
		/// <param name="programId">标识列</param>
		/// <returns></returns>
		public Program GetModel(int programId)
		{
			return pDal.GetModel(programId);
		}
		#endregion

        #region  根据类别获得数据列表
        /// <summary>
        /// 根据类别获得数据列表
        /// </summary>
        /// <param name="programClassId"></param>
        /// <returns></returns>
        public IList<Program> GetModelByClass(int programClassId)
        {
            return pDal.GetModelByClass(programClassId);
        }
        #endregion

        #region 修改信息
        /// <summary>
		/// 修改信息
		/// </summary>
		/// <param name="Program">实体</param>
		/// <returns></returns>
		public bool Update(Program program)
		{
			 return pDal.Update(program);
		}
		#endregion

        #region 批量移动
        /// <summary>
        /// 批量移动
        /// </summary>
        /// <param name="id"></param>
        /// <param name="programClassId"></param>
        /// <returns></returns>
        public bool Update(string[] id, string programClassId)
        {
            return pDal.Update(id, programClassId);
        }
        #endregion

        #region 删除信息
        /// <summary>
		/// 删除信息
		/// </summary>
		/// <param name="programId">标识列</param>
		/// <returns></returns>
		public bool Delete(int programId)
		{
			 return pDal.Delete(programId);
		}
		#endregion

        #region 批量删除
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="pId"></param>
        /// <returns></returns>
        public bool Delete(string[] pId) 
        {
            return pDal.Delete(pId);
        }
        #endregion


        #region 添加信息
        /// <summary>
		/// 添加信息
		/// </summary>
		/// <param name="Program">实体</param>
		/// <returns></returns>
		public bool Insert(Program program)
		{
			 return pDal.Insert(program);
		}
		#endregion

        #region 根据项目类别id得到数量
        /// <summary>
        /// 根据项目类别id得到数量
        /// </summary>
        /// <param name="programClassId"></param>
        /// <returns></returns>
        public int countByProgramClass(int programClassId)
        {
            return pDal.countByProgramClass(programClassId);
        }
        #endregion

        #region 分页
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="programClassId"></param>
        /// <returns></returns>
        public DataTable pagingForProgram(int pageIndex, int pageSize, int programClassId)
        {
            return pDal.pagingForProgram(pageIndex, pageSize, programClassId);
        }
        #endregion

        #region 获得数量
        /// <summary>
        /// 获得数量
        /// </summary>
        /// <param name="programClassId"></param>
        /// <returns></returns>
        public int getRecordCount(int programClassId)
        {
            return pDal.getRecordCount(programClassId);
        }
        #endregion
    }
}
